@import "compass/css3";

.wrapper {
  width: 30%;
  display: inline-block;
  padding-bottom: 1em;
}

.wrapper h1 {
  text-align: center;
  font-size: 1.5em;
}

.cube {
  font-size: 2em;
  width: 2em;
  height: 2em;
  margin: .5em auto;
  transform-style: preserve-3d;
  perspective: 250px;
}

.w1 .cube { perspective-origin: top left; }
.w2 .cube { perspective-origin: top; }
.w3 .cube { perspective-origin: top right; }
.w4 .cube { perspective-origin: left; }
.w5 .cube { perspective-origin: center; }
.w6 .cube { perspective-origin: right; }
.w7 .cube { perspective-origin: bottom left; }
.w8 .cube { perspective-origin: bottom; }
.w9 .cube { perspective-origin: bottom right; }

.side {
  position: absolute;
  width: 2em;
  height: 2em;
  
  background: rgba(tomato, .6);
  border: 1px solid rgba(0,0,0,.5);
  
  color: white; 
  text-align: center;
  line-height: 2em;
}

.front  { transform:                  translateZ(1em); }
.top    { transform: rotateX( 90deg)  translateZ(1em); }
.right  { transform: rotateY( 90deg)  translateZ(1em); }
.left   { transform: rotateY(-90deg)  translateZ(1em); }
.bottom { transform: rotateX(-90deg)  translateZ(1em); }
.back   { transform: rotateY(-180deg) translateZ(1em); }